package FilePackage;
import java.util.*;
import java.io.*;
public class File_Directory {
	//main procedure
	public static void main (String[] arg){
		Scanner scanner=new Scanner (System.in);
		System.out.println("Enter directory: ");
		String Path=scanner.nextLine();
		printListFiles(Path);
	}
	//procedure to print content of directory
	public static void printListFiles(String Path){
		File Directory = new File(Path);
		if (Directory.exists())
		{
			String[] List;
			if (Directory.isDirectory()) 
				{
				List = Directory.list();
				System.out.println(Path+" >>>");
				for (int i=0;i<List.length;i++) System.out.println("\t" + List[i]);
				}
			else System.out.println("No directory...");
		}
		else System.out.println("Directory is not found...");
		}
}